<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    {if $readable}
    <div>
        {if !$readable[0]}
            <p style="color: red; font-size: 30px;">检测到需要写入的文件目录没有写入权限</p>
        {/if}
        <table>
        {foreach name="$readable[1]" key="name" item="value"}
            <tr><th>{$name}</th><td>{$value}</td></tr>
        {/foreach}
        </table>
    </div>
    {/if}
    
    <style>
        .actions li{
            display: inline;
        }
    </style>
    <ul class="actions">
        <li><a href="{:url('updateAll')}">刷新全部已安装模块</a></li>
        <li><a href="{:url('examineAll')}">检测</a></li>
    </ul>
    <table>
        <thead>
            <tr>
                <td>标识</td>
                <td>简介</td>
                <td>安装类</td>
                <td>依赖模块</td>
                <td>状态</td>
                <td>操作</td>
            </tr>
        </thead>
        <tbody>
            {foreach name="$modules" item="vo"}
            <tr>
                <td>{$vo.id|default=''}</td>
                <td>{$vo.description|default=''}</td>
                <td>{$vo.logic|default=''}</td>
                <td>{:implode(",",$vo.require)}</td>
                <td>{$vo.status_str|default=''}</td>
                <td>
                    {if $vo.status === 'available'}
                        <a href="{:url('module/install',['module'=>$vo.id])}">安装</a>&nbsp;&nbsp;
                    {elseif $vo.status === 'installed' /}
                        <a href="{:url('module/update',['module'=>$vo.id])}">刷新</a>&nbsp;&nbsp;
                        <a href="{:url('module/clear',['module'=>$vo.id])}">清空</a>&nbsp;&nbsp;
                        <a href="{:url('module/forbidden',['module'=>$vo.id])}">禁用</a>&nbsp;&nbsp;
                        <a href="{:url('module/uninstall',['module'=>$vo.id])}">卸载</a>&nbsp;&nbsp;
                    {elseif $vo.status === 'forbidden' /}
                        <a href="{:url('module/unforbidden',['module'=>$vo.id])}">解除禁用</a>&nbsp;&nbsp;
                        <a href="{:url('module/uninstall',['module'=>$vo.id])}">卸载</a>&nbsp;&nbsp;
                    {elseif $vo.status === 'fragmentary' /}
                        <a href="{:url('module/install',['module'=>$vo.id])}">安装</a>&nbsp;&nbsp;
                        <a href="{:url('module/uninstall',['module'=>$vo.id])}">卸载</a>&nbsp;&nbsp;
                    {/if}
                    <a href="{:url('module/config',['module'=>$vo.id])}">配置</a>&nbsp;&nbsp;
                </td>
            </tr>
            {/foreach}
        </tbody>
    </table>
</body>
</html>
